<?php

class Application_Form_Editerreponse extends Zend_Form
{

    public function init()
    {
        /* Form Elements & Other Definitions Here ... */
    	
    	$mapper= new Application_Model_Mapper_Typereponse();
    	$select=$mapper->fetchAllToArray();
    	
    	$tmp=array();
    	$tmp['']="selectionner un Type";
    	foreach ($select as $key => $value ){
    		$tmp[ $value['idtypereponse'] ] = $value['idtypereponse'];
    	}
    	$typereponse = array("multiOptions" => $tmp);
    	
    	$typrsp= new Zend_Form_Element_Select('typereponse_idtypereponse',  $typereponse);
    	$typrsp->setLabel('Type de reponse ')	;
    	
    	$Reponse = new Zend_Form_Element_Textarea('labelrepense');
    	$Reponse->setLabel('Reponse:')
    	->setRequired(true)
    	->setAttrib('COLS', '40')
    	->setAttrib('ROWS', '4');
    	
    	$Help = new Zend_Form_Element_Textarea('descriptionhelp');
    	$Help->setLabel('Help:')
    	->setRequired(true)
    	->setAttrib('COLS', '40')
    	->setAttrib('ROWS', '4');
    	
    	$Score = new Zend_Form_Element_Text('score');
    	$Score->setLabel('Nombre de reponse Juste: ')
    	->setRequired(true)
    	->addFilter('StripTags')
    	->addFilter('StringTrim')
    	->addValidator('NotEmpty');
    	
    	$reponsevrai=new Zend_Form_Element_Radio("repensevrai");
    	$reponsevrai->setLabel("Reponse : ");
    	
    	$reponsevrai->addMultiOptions(array(
    	
    			'Oui' => 'Juste',
    	
    			'Faux' => 'Faux'
    	
    	))
    	->setSeparator('');
    	
    	
    	$submit = new Zend_Form_Element_Submit('submit',"Enregistrer");
    	 
    	$this->addElements(array($Reponse,$typrsp,$Help,$reponsevrai,$Score,$submit));
    	$this->setDecorators( array( array('ViewScript', array('viewScript' => 'protypeform.phtml'))));
    	
    	
    }


}

